package com.yeren.innerClass;

import java.util.Timer;
import java.util.TimerTask;

public class InnerClassDemo1 {
	public static void main(String[] args) {
		Cat cat=new Cat();
		cat.start();
	}
}

class Cat{
	String name ="haha";
	public void start(){
		Timer timer =new Timer();
		timer.schedule(new RunTask(), 0,1000);
	}
	
	private class RunTask extends TimerTask{
		public void run(){
			System.out.println(name+"在跑...");
		}
	}
}